package pl.smath.view.utils;

/**
 * Cursor represents the current position on the Canvas
 * @author damian
 *
 */
public class Cursor {
	private Double x;
	private Double y;
	
	/**
	 * Constructor
	 */
	public Cursor() {
		this(0., 0.);
	}
	
	/**
	 * Constructor
	 */
	public Cursor(Double x, Double y) {
		setPosition(x, y);
	}
	
	/**
	 * get the x position
	 * @return x position in pixels on the canvas
	 */
	public Double getX() {
		return this.x;
	}
	
	/**
	 * set the x position on the canvas
	 * @param x
	 */
	public void setX(Double x) {
		this.x = x;
	}

	/**
	 * get the x position
	 * @return x position in pixels on the canvas
	 */
	public Double getY() {
		return this.y;
	}

	
	/**
	 * set the y position on the canvas
	 * @param y
	 */
	public void setY(Double y) {
		this.y = y;
	}
	
	/**
	 * set the x and y position on the canvas
	 * @param x
	 * @param y
	 */
	public void setPosition(Double x, Double y) {
		setX(x);
		setY(y);
	}
	
	/**
	 * return string representation
	 * @return string
	 */
	@Override
	public String toString() {
		return "cursor: "+this.getX()+" "+this.getY();
	}
}
